
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<%
			request.setCharacterEncoding("UTF-8");
			response.setContentType("text/html;charset=utf-8");
		%>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>产品查询</title>
		<%@ include file="../../../common/meta.jsp"%>
		<link rel="stylesheet" href="${path}/css/jquery.autocomplete.css"
			type="text/css"></link>
		<script type="text/javascript"
			src="${path }/script/jquery.autocomplete.js">
</script>
		<style type="text/css">
#title { 
	display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 125px; } 
</style>

</style>
		<script type="text/javascript">
$(document).ready(function() {
	
		var requestUrl = "${path}/common/index/getprovider";
		var Url = "${path}/common/index/getproduct";
		$.ajax( {
			type : "post",//默认为get   
			dataType : "json",
			url : requestUrl,
			success : function(providerList) {
			// 供应商
				$("#provides").autocomplete(providerList, {
					minChars : 0,
					max : 200,
					width : 200,
					matchContains : "word",
					autoFill : true,
					formatItem : function(row, i, max) {
						return row.providercode + ":" + row.providerabbr;
					},
					formatMatch : function(row, i, max) {
						return row.providercode + ":" + row.providerabbr;
					},
					formatResult : function(row) {
						return row.providercode + ":" + row.providerabbr;
					}
				});	
			}
		});
		$.ajax( {
			type : "post",//默认为get   
			dataType : "json",
			url : Url,
			success : function(providerList) {
				//产品代码
				$("#productCode").autocomplete(providerList, {
					minChars : 0,
					max : 200,
					width : 200,
					matchContains : "word",
					autoFill : true,
					formatItem : function(row, i, max) {
						return row.productcode;
					},
					formatMatch : function(row, i, max) {
						return row.productcode;
					},
					formatResult : function(row) {
						return row.productcode;
					}
				});
				//产品名称
				$("#productTitle").autocomplete(providerList, {
					minChars : 0,
					max : 200,
					width : 200,
					matchContains : "word",
					autoFill : true,
					formatItem : function(row, i, max) {
						return row.productname;
					},
					formatMatch : function(row, i, max) {
						return row.productname;
					},
					formatResult : function(row) {
						return row.productname;
					}
				});

			}
		});
		
	});

function doQuery() {
	document.form1.action = "${path}/routine/product/index";
	document.form1.submit();
}
</script>
	</head>
	<body id="master">
		<sfa:mainHeader></sfa:mainHeader>
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					产品查询
				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding-top: 12px;">
					<div class="search" >
						<!----------- 查询信息 ------------------>
						<form method="get">
							<table cellpadding="0" cellspacing="0" align="center" >
								<tr>
									<th>
										供应商 :
									</th>
									<td>
										<input type="text" class="input-txt" name="provides"
											id="provides" value="${provides}" />
									</td>
									
									<th>
										产品名称 :
									</th>
									<td>
										<input type="text" name="productTitle" id="productTitle"
											value="${productTitle}" class="input-txt" />
									</td>
								<th>
										产品代码 :
									</th>
									<td>
										<input type="text" class="input-txt" name="productCode"
											id="productCode" value="${productCode}" />
									</td>
								</tr>
								<tr>	
									<th>
										所属机构
									</th>
									<td>
											<select class="input-txt" name="branchId" id="branchId" disabled="disabled"> 
											<c:forEach items="${BranchList}" var="branch">
												<option value="${branch.branchId }"
													<c:if test="${branchId==branch.branchId }">selected='selected'</c:if>  >
													${branch.branchName}
												</option>
											</c:forEach>
										</select>
									</td>
									<th>
										销售渠道
									</th>
									<td>
										<sfa:dic showType="select" kindNo="CHANNELTYPE"
											code="${channeltype}" def="ALL:全部;" attr="class='input-txt'"
											name="channeltype" id="channeltype" ></sfa:dic>
	
									</td>
									<th>
									销售状态
								</th>
								<td>

									<sfa:dic showType="select" kindNo="SALESTATUS"
											code="${salestatus}" def="ALL:全部;" attr="class='input-txt'"
											name="salestatus" id="salestatus"></sfa:dic>
								</td>
								</tr>
								<tr>
								<td colspan="5" align="center">
									<input type="submit" class="linkbtn2" value="查询" />
									<input type="button" class="linkbtn2" onclick="location.href='${path}/routine/product/index';" value="重置" />
										
									</td>
								</tr>
									
							</table>
						</form>
					</div>
					<!----------- 数据列表 ------------------>
					<table cellpadding="0" cellspacing="0" class="dg_borderstyle trStyleTable"
						style="margin-top: 15px;">
						<tr>
							<th name="fixcol"><span>序号</span></th>  
							<th>
								供应商
							</th>
							<th>
								产品代码
							</th>
							<th>
								产品名称
							</th>
							<th>
								销售状态
							</th>
							<th>
								附件
							</th>
						</tr>

						<c:forEach items="${pagination.resultList}" var="product" varStatus="ind">
							<tr >
								<td>${(pagination.page-1)*10+(ind.index+1)}</td> 
								<td align="left" width="25%">
									${product.providername}
								</td>
								<td align="center" width="20%">
									${product.PRODUCTCODE}
								</td>
								<td align="center" width="20%">
									<a id="title"
										href="${path}/routine/product/index/detail/${product.PRODUCTID}" title="${product.PRODUCTNAME}">${product.PRODUCTNAME}</a>
								</td>
								<td align="center" width="20%">
									${product.stopnotice}
								</td>
								<td align="center" width="20%">
									<c:if test="${product.ISAFFIX=='Y'}">是</c:if>
									<c:if test="${product.ISAFFIX=='N'}">否</c:if>
								</td>
							</tr>
						</c:forEach>
						
					</table>
					<!----------- 翻页导航 ------------------>
					<div class="dg_pagerstyle">
						<div class="pageinfo">
						<c:if test="${not empty pagination.multiPage}">
							   第${pagination.page }页 | 共${pagination.totalPages }页/${pagination.totalRows }条记录
						</c:if>
						</div>
						<div class="pagebtn">
							${pagination.multiPage}
						</div>
					</div>
				</div>
			</div>
			<div class="webpart-foot">
				<div class="webpart-foot-item">
				</div>
			</div>
		</div>
		<!----------- 页面脚本 ------------------>
		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>
